<html>
<head>
<script type="text/javascript">
function showQuery(str)
{
	alert("je suis dans le js");
	alert("texte:"+str);
if (str=="")
  {
  document.getElementById("txtHint").innerHTML="pas de resultat";
  return;
  } 
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    alert("je passe ds le txtint");
    }
  }
xmlhttp.open("GET","requetes.php?req="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<h1>test de requetes SQL</h1>
<form  name="formRequetes" >
Requete: <input	type="text" id="requete" name="requete"><br>
<input type="button" value="OK" onclick="showQuery( document.getElementById('requete').value)">

</form>
<div id="txtHint"><b>Le resultat se trouvera ici</b></div>
</body>
</html>
